package DynamicArr;

public class Test {
    public static void main(String[] args) {
        MyArray myArrays = new MyArray(3);
        System.out.println("测试数组的加操作：");
        myArrays.addLast(1);
        myArrays.addLast(3);
        myArrays.addLast(5);
        myArrays.addLast(7);
        System.out.println(myArrays);
        myArrays.addFirst(10);
        myArrays.addFirst(20);
        myArrays.addFirst(30);
        System.out.println(myArrays);
        myArrays.addIndex(8, 100);
        myArrays.addIndex(1, 100);
        myArrays.addIndex(1, 100);
        myArrays.addIndex(1, 100);
        myArrays.addIndex(1, 200);
        myArrays.addIndex(1, 200);
        myArrays.addIndex(1, 200);
        System.out.println(myArrays);
        System.out.println("测试数组的删操作：");
        myArrays.removeValueOnce(100);
        myArrays.removeAllValue(200);
        myArrays.removeIndex(1);
        myArrays.removeLast();
        myArrays.removeFirst();
        myArrays.removeIndex(5);
        System.out.println(myArrays);
        System.out.println("测试数组的查找操作：");
        myArrays.get(5);
        System.out.println(myArrays.get(4));
        System.out.println(myArrays.getByValue(10));
        System.out.println(myArrays.getByValue(5));
        System.out.println(myArrays.contains(3));
        System.out.println(myArrays.contains(4));
        System.out.println("数组的修改操作");
        System.out.println(myArrays.set(2,5));
        System.out.println(myArrays);
    }
}
